package com.cds.alert.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.cds.alert.dao.AlertAlarmMailMapper;
import com.cds.alert.ibatis.Criteria;
import com.cds.alert.pojo.AlertAlarmMail;
import com.cds.alert.service.AlertAlarmMailService;

@Service("alertAlarmMailService")
public class AlertAlarmMailServiceImpl implements AlertAlarmMailService {

	@Autowired
	AlertAlarmMailMapper alertAlarmMailMapper;
	
	@Transactional(readOnly = true)
	public AlertAlarmMail selectByPrimaryKey(Long id) {
		return alertAlarmMailMapper.selectByPrimaryKey(id);
	}
	
	@Transactional(readOnly = true)
	public List<AlertAlarmMail> query(Criteria example) {
		return alertAlarmMailMapper.queryByExample(example);
	}
	
	@Transactional(readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = { Exception.class })
	public void insert(AlertAlarmMail entiry) {
		alertAlarmMailMapper.insert(entiry);
	}
	
	@Transactional(readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = { Exception.class })
	public void insertSelective(AlertAlarmMail entiry) {
		alertAlarmMailMapper.insertSelective(entiry);
	}
}
